package com.changgou.search.listener;

import com.changgou.search.config.RabbitMQConfig;
import com.changgou.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * Created by 柱子 on 2020/10/22 18:17   接受MQ消息导入  删除索引信息
 */
@Component
public class GoodsDelListener {


    @Autowired
    private ESManagerService esManagerService;

    @RabbitListener(queues = RabbitMQConfig.SEARCH_DEL_QUEUE)
    public void receiveMessage(String spuId) {

        System.out.println("接收到的删除ID为：" + spuId);

        //查询SkuList 导入索引库
        esManagerService.delDataBySpuId(spuId);
    }

}
